From 1e84ec1ca0833057fa65f78dc19ad53d33ffc9ef Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 16 Sep 2016 16:32:23 +0100 Subject: [PATCH] arm64/mm: Limit TASK_SIZE_64 for compatibility Some programs assume they can use 17 tag bits in a 64-bit pointer, which works on most other 64-bit architectures but not on arm64 with CONFIG_ARM64_VA_BITS_48. To maintain compatibility with these programs, limit TASK_SIZE_64 to a maximum of 1 << 47. Signed-off-by: Ben Hutchings Gbp-Pq: Topic bugfix/arm64 Gbp-Pq: Name arm64-mm-limit-task_size_64-for-compatibility.patch --- arch/arm64/include/asm/memory.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 31b73227b41..6e0b8099f30 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -74,7 +74,12 @@ #define PCI_IO_END (VMEMMAP_START - SZ_2M) #define PCI_IO_START (PCI_IO_END - PCI_IO_SIZE) #define FIXADDR_TOP (PCI_IO_START - SZ_2M) +#if VA_BITS <= 47 #define TASK_SIZE_64 (UL(1) << VA_BITS) +#else +/* User-space might use up to 17 tag bits in 64-bit pointers */ +#define TASK_SIZE_64 (UL(1) << 47) +#endif #ifdef CONFIG_COMPAT #define TASK_SIZE_32 UL(0x100000000) -- 2.30.2